package GUI;

import java.awt.BorderLayout;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class MainFrame extends JFrame {
	private DefaultMenu myMenu;
	private BorderLayout layout;
	private JPanel currentPanel;
	/**
	 * 
	 */
	private static final long serialVersionUID = 3858229905442780638L;
	public MainFrame() {
		super();
		this.setMinimumSize(new Dimension(800,600));
		this.setPreferredSize(new Dimension(800,600));
		myMenu = new DefaultMenu(this);
		layout = new BorderLayout();
		this.setLayout(layout);
		this.add(myMenu, BorderLayout.NORTH);
		currentPanel = new JPanel();
		currentPanel.add(new JLabel("Willkommen im PostgreSQL-Praktikumsteam-Client des Piratebayshops"));
		this.add(currentPanel, BorderLayout.CENTER);
	}
	public void setCenterPanel(JPanel panel) {
		this.remove(currentPanel);
		this.currentPanel = panel;
		this.add(this.currentPanel, BorderLayout.CENTER);
		this.validate();
	}
}
